<template>
  <div>
    <div v-if="customerName!=''">
      <span class="padding-l-sm">
        客户:
      </span>
      <span class="padding-l-sm" style=“display:inline-block;width:60%;word-wrap:break-word;white-space:normal;>
        {{ customerName }}
      </span>
    </div>
    <div v-if="saleName!=''">
      <span class="padding-l-sm">
        销售:
      </span>
      <span class="padding-l-sm"  style=“display:inline-block;width:60%;word-wrap:break-word;white-space:normal;>
        {{ saleName }}
      </span>
    </div>
    <div v-if="departmentName!=''">
      <span class="padding-l-sm">
        部门:
      </span>
      <span class="padding-l-sm" style=“display:inline-block;width:60%;word-wrap:break-word;white-space:normal;>
        {{ departmentName }}
      </span>
    </div>
    <div v-if="countryName!=''">
      <span class="padding-l-sm">
        国家:
      </span>
      <span class="padding-l-sm" style=“display:inline-block;width:60%;word-wrap:break-word;white-space:normal;>
        {{ countryName }}
      </span>
    </div>
    <div v-if="channelName!=''">
      <span class="padding-l-sm">
        渠道:
      </span>
      <span class="padding-l-sm" style=“display:inline-block;width:60%;word-wrap:break-word;white-space:normal;>
        {{ channelName }}
      </span>
    </div>
    <div v-if="channelTypeName!=''">
      <span class="padding-l-sm">
        渠道类型:
      </span>
      <span class="padding-l-sm" style=“display:inline-block;width:60%;word-wrap:break-word;white-space:normal;>
        {{ channelTypeName }}
      </span>
    </div>
  </div>
</template>

<script>
export default {
  props: ["row", "data", "more"],
  data() {
    return {
      customerName: '',
      saleName:'',
      departmentName:'',
      countryName:'',
      channelName:'',
      channelTypeName:'',
      customerMap:{},
      saleMap:{},
      departmentMap:{},
      countryMap:{},
      channelMap:{},
      channelTypeMap:{}
    }
  },
  mounted() {
    this.initShow();
  },
  methods: {
     initShow() {
      var customerId = this.data["customerId"];
      var sale = this.data["sale"];
      var departmentId = this.data["departmentId"];
      var countryId = this.data["countryId"];
      var channel = this.data["channel"];
      var channelType = this.data["channelType"];
      this.customerMap = this.$store.state.main.entry.sources[
        "customerSource"
        ];
      if (this.customerMap) {
        for(var i=0; i<customerId.length; i++){
          this.customerName +=this.customerMap[customerId[i]]+",";
        }
      }
      this.saleMap = this.$store.state.main.entry.sources[
        "userSource"
        ];
      if (this.saleMap) {
        for(var i=0; i<sale.length; i++){
          this.saleName +=this.saleMap[sale[i]]+",";
        }
      }
      this.departmentMap = this.$store.state.main.entry.sources[
        "userDeparSource"
        ];
      if (this.departmentMap) {
        for(var i=0; i<departmentId.length; i++){
          this.departmentName +=this.departmentMap[departmentId[i]]+",";
        }
      }
      this.countryMap = this.$store.state.main.entry.sources[
        "countrySource"
        ];
      if (this.countryMap) {
        for(var i=0; i<countryId.length; i++){
          this.countryName +=this.countryMap[countryId[i]]+",";
        }
      }
      this.channelMap = this.$store.state.main.entry.sources[
        "channelNameSource"
        ];
      if (this.channelMap) {
        for(var i=0; i<channel.length; i++){
          this.channelName +=this.channelMap[channel[i]]+",";
        }
      }
      this.channelTypeMap = this.$store.state.main.entry.sources[
        "shippingWaySource"
        ];
      if (this.channelTypeMap) {
        for(var i=0; i<channelType.length; i++){
          this.channelTypeName +=this.channelTypeMap[channelType[i]]+",";
        }
      }
    }
  }
}
</script>

<style scoped>

</style>
